package Practice17;

public class MyThread2 extends Thread {
    public void run() {
        for (int i = 0; i < 100; i++) {

            if ((i) % 10 == 0) {
                System.out.println("------" + i);
            }
            System.out.println(i);
            try {
                Thread.sleep(1000);
                System.out.println("线程休眠1秒");
            } catch (InterruptedException e) {
                e.fillInStackTrace();
            }
        }
    }

    public static void main(String[] args) {
        new MyThread2().start();
    }

}
